//
//  HCCallListModel.h
//  HelloCall
//
//  Created by WangYongpeng on 13-9-21.
//  Copyright (c) 2013年 HC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HCComModel.h"

@class HCCRMCustomInfo;

typedef enum
{
    CallSourceType_spread,        //推广来源
    CallSourceType_allocation,    //企业分配
    CallSourceType_visit,         //定时回访
}CallSourceType;

typedef enum
{
    CallInfoType_untreated,         //未处理
    CallInfoType_giveUp,            //放弃
    CallInfoType_shift,             //申请转移
    CallInfoType_superCRM,          //录入CRM
}CallInfoType;



//话单详情
@interface HCCallInfo : NSObject

@property (nonatomic, retain)NSString*          ticketID;
@property (nonatomic, assign)int                ID;
@property (nonatomic, copy)NSString*            phoneNumber;    //电话好吗
@property (nonatomic, assign)CallInfoType       callInfoType;   //话单状态
@property (nonatomic, assign)CallSourceType     callSourceType; //来源类型
@property (nonatomic, retain)NSString*          callSource;
@property (nonatomic, retain)NSDate*            initTime;       //初始化时间
@property (nonatomic, assign)int                callNumber;     //通话次数
@property (nonatomic, assign)int                sumCallTime;    //通话时长
@property (nonatomic, retain)NSDate*            visitDelay;     //回访延时

//@property (nonatomic, retain)NSMutableArray*    remarkInfoList; //备注列表

- (void)copy:(HCCallInfo*)info;

@end

//@protocol HCCallListModelDelegate <HCModelDataObserver>
//
//- (void)callInfoListDataUpdate;
//- (void)ticketDetailDataUpdate;
//
//@end

@interface HCCallListModel : HCComModel

@property (nonatomic, assign)int numCount; //号码数量
@property (nonatomic, assign)int tgNumCount; //推广来源
@property (nonatomic, assign)int assignNumCount; //企业分配数
@property (nonatomic, assign)int callbackNumCount; //回访总数
@property (nonatomic, retain)NSString* selfPhoneNumber;
//@property (nonatomic, assign)id<HCCallListModelDelegate> delegate;

+ (HCCallListModel*)defaultModel;
- (void)reset;
- (NSArray*)getCallInfoArrayWithType:(CallInfoType)type;
- (int)getCallInfoCountWithSourceType:(CallSourceType)type;
- (int)getAllCallInfoCount;
- (void)changeCallInfoTypeByID:(int)id callInfoType:(CallInfoType)type;
- (void)addCallInfoByCustomInfo:(HCCRMCustomInfo*)customInfo callInfoType:(CallInfoType)type;

- (void)addCallInfo:(HCCallInfo*)info type:(CallInfoType)type;
- (BOOL)modifyCallInfo:(HCCallInfo*)info byUserId:(NSString*)userID;
- (HCCallInfo*)getCallInfobyUserId:(NSString*)userID;
@end
